package com.bite.common.core.controller;

import com.bite.common.core.domain.R;
import com.bite.common.core.enums.ResultCode;

public class BaseController {

    public R<Void> toR(int affectedRows) {
        return affectedRows > 0 ? R.ok() : R.fail(ResultCode.FAILED);
    }

    public R<Void> toR(boolean result) {
        return result ? R.ok() : R.fail(ResultCode.FAILED);
    }
}
